package com.lemon.components.ant.apimaker.enums;

import java.util.List;

public enum ResultType {

	ResultSingle("ResultSingle", "单一结果"),
	ResultSet("ResultSet", "结果集");

	private String code;
	private String message;

	public static ResultType getEnumByMessage(String message) {
		if (message == null)
			return null;
		for (ResultType _enum : values()) {
			if (_enum.getMessage().equalsIgnoreCase(message)) {
				return _enum;
			}
		}
		return null;
	}

	/**
	 * Get all enums
	 * 
	 * @return List<ResultType>
	 */
	public static List<ResultType> getAllEnum() {
		List<ResultType> list = new java.util.ArrayList<ResultType>(values().length);
		for (ResultType _enum : values()) {
			list.add(_enum);
		}
		return list;
	}

	/**
	 * Get all enums code
	 * 
	 * @return List<String>
	 */
	public static List<String> getAllEnumCode() {
		List<String> list = new java.util.ArrayList<String>(values().length);
		for (ResultType _enum : values()) {
			list.add(_enum.getCode());
		}
		return list;
	}

	private ResultType(String code, String message) {
		this.code = code;
		this.message = message;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}